package com.huaxin.hxmodulesystem.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@Schema(description = "新增系统字典请求DTO")
public class AddSysDictionaryReqDTO {

    @NotBlank(message = "字典类型不能为空")
    @Schema(description = "字典类型（如：order_status, payment_method）", requiredMode = Schema.RequiredMode.REQUIRED, example = "order_status")
    private String dictType;

    @NotBlank(message = "字典键不能为空")
    @Schema(description = "字典键（唯一标识）", example = "order_pending")
    private String dictKey;

    @Schema(description = "字典值（JSON格式，如 {\"zh\":\"待处理\",\"en\":\"Pending\"}）")
    private String dictValue;

    @Schema(description = "描述说明", example = "订单初始状态")
    private String dictDesc;

    @Schema(description = "排序序号", example = "10")
    private Integer sortOrder;

    @Schema(description = "是否启用（0=禁用，1=启用）", example = "1")
    private Integer isActive;

    @Schema(description = "版本号", example = "1")
    private Integer version;

    @Schema(description = "生效开始时间", example = "2025-01-01 00:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime validFrom;

    @Schema(description = "生效结束时间（null 表示长期有效）", example = "2025-12-31 23:59:59")
    private LocalDateTime validTo;
}